package com.jay.base.lock;

/**
 * Created by caoyuan7 on 2020/8/11.
 */
public class TestDemo10 {
    public static synchronized void lock1(){
        System.out.println("lock1");
        lock2();
    }
    public static synchronized void lock2(){
        System.out.println("lock2");
    }
    public static void main(String[] args) {
        new Thread(){
            @Override
            public void run() {
                TestDemo10 lock = new TestDemo10();
                lock.lock1();
            }
        }.start();
    }
}
